package cn.threewaters.qtyy.web.controller.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cn.threewaters.qtyy.common.bean.PageBean;
import cn.threewaters.qtyy.common.bean.ResponseJson;
import cn.threewaters.qtyy.dic.one.queryparam.QueryNh;
import cn.threewaters.qtyy.dic.one.queryresult.ResultNh;
import cn.threewaters.qtyy.service.business.NhService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;

@Api(tags = "能耗")
@Controller
@RequestMapping(value = "/nenghao")
public class NhController {
	
	@Autowired
	private NhService nhService;

	@ApiIgnore
	@ApiOperation(value = "能耗展示页面")
	@RequestMapping(value = "/main", method = RequestMethod.GET)
	public ModelAndView main(ModelMap modelMap) {
		return new ModelAndView("business/nenghao/nenghao", modelMap);
	}
	@ApiOperation(value = "概览")
	@RequestMapping(value = "/GLlist", method = RequestMethod.GET)
	@ResponseBody
	public ResponseJson getGLList(PageBean page, QueryNh queryNh) throws Exception {
		List<ResultNh> nhGLs = nhService.queryNhGL(queryNh);
		return ResponseJson.builder().success(true).obj(nhGLs).build();
	}

}
